package com.cg.config;

import com.cg.service.NoticeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;

/**
 * @ClassName NoticeIsShowConfig
 * @Description TODO
 * @Author CG
 * @Date 2023/12/18 14:05
 **/
@Configuration
@EnableScheduling
public class NoticeIsShowConfig {

    private final Logger logger = LoggerFactory.getLogger(NoticeIsShowConfig.class);

    @Resource
    private NoticeService noticeService;

    @Scheduled(cron = "0 18 14 * * ?")
    public void setNoticeIsShow(){
        Integer count = noticeService.setIsShow();
        logger.info("修改了"+count+"条数据");
    }

}
